package com.crm.system.controller.opportunityManager;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhPageInfo;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.entity.contactManager.Contact;
import com.crm.model.entity.contractManager.CustomerContract;
import com.crm.model.entity.customerManager.*;
import com.crm.model.entity.opportunityManager.Opportunity;
import com.crm.model.entity.opportunityManager.*;
import com.crm.model.entity.productManager.CustomerMemberProduct;
import com.crm.model.entity.productManager.CustomerProduct;
import com.crm.model.entity.sys.UserAccount;
import com.crm.model.entity.sys.permissionManagement.SysCompany;
import com.crm.model.qo.cluePoolManager.ClueFollowQO;
import com.crm.model.qo.contractManager.CustomerContractAddQO;
import com.crm.model.qo.opportunityManager.AddOpportunityQO;
import com.crm.model.qo.opportunityManager.OpportunityQO;
import com.crm.model.qo.opportunityManager.OpportunityStatusQO;
import com.crm.model.vo.contactManager.AddContactVO;
import com.crm.model.vo.customerContractManager.CustomerContractEditVO;
import com.crm.model.vo.customerContractManager.CustomerContractVO;
import com.crm.model.vo.customerManager.FzCustomerContactVO;
import com.crm.model.vo.opportunityManager.*;
import com.crm.system.service.contactManager.ContactService;
import com.crm.system.service.contractManager.CustomerContractService;
import com.crm.system.service.customerManager.CustomerService;
import com.crm.system.service.opportunityManager.*;
import com.crm.system.service.productManager.CustomerMemberProductService;
import com.crm.system.service.productManager.CustomerProductService;
import com.crm.system.service.user.UserAccountService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.annotation.Contract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 商机管理信息
 */
@RestController
@RequestMapping("/opportunity")
@Slf4j
public class OpportunityController {

    @Autowired
    private OpportunityService opportunityService;

    @Autowired
    private ContactService contactService;

    @Autowired
    private CustomerProductService customerProductService;

    @Autowired
    private OpportunityCollaboratorService opportunityCollaboratorService;

    @Autowired
    private OpportunityDynamicService opportunityDynamicService;

    @Autowired
    private OpportunityPhraseService opportunityPhraseService;

    @Autowired
    private OpportunityProductService opportunityProductService;

    @Autowired
    private OpportunityContactService opportunityContactService;

    @Autowired
    private OpportunityGiftService opportunityGiftService;

    @Autowired
    private CustomerContractService customerContractService;

    @Autowired
    private DemandAnalysisService demandAnalysisService;

    @Autowired
    private DemandResearchService demandResearchService;

    @Autowired
    private CompetitorService competitorService;

    @Autowired
    private CustomerMemberProductService memberProductService;

    /**
     * 管理模块 -- 联系管理列表
     * @return
     */
    @PostMapping("/selectOpportunityVoList")
    public DataResponse selectOpportunityVoList(HttpServletRequest request,
                                                @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                                @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                                @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                                @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                                OpportunityQO opportunityQO//查询条件
    ){
        try{
            DhPageInfo<OpportunityVO> contactVOList = opportunityService.selectOpportunityVoList(pageIndex,pageSize,opportunityQO,sortName,sortOrder);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),contactVOList);
        }catch(Exception e){
            log.error("opportunity selectOpportunityVoList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增商机
     * @param addOpportunityQO 新增商机实体
     * @return
     */
    @PostMapping("/addOpportunity")
    public DataResponse addOpportunity(@RequestBody AddOpportunityQO addOpportunityQO) {
        Boolean result = opportunityService.addOpportunity(addOpportunityQO);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-删除商机-修改商机删除标记
     * @param opportunityId
     * @return
     */
    @PostMapping("/updateOpportunity")
    public DataResponse updateOpportunity(
            @RequestParam(value="opportunityId",required = false) String opportunityId) {
        Boolean result = opportunityService.updateOpportunity(opportunityId);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理 -- 修改回显
     * @return
     */
    @PostMapping("/getOpportunityId")
    public DataResponse getOpportunityId(
            @RequestParam(value="opportunityId",required = false) String opportunityId){
        try{
            OpportunityCustomerVO opportunity = opportunityService.getOpportunityId(opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),opportunity);
        }catch(Exception e){
            log.error("opportunity getOpportunityId error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-修改商机
     * @param opportunity
     * @return
     */
    @PostMapping("/updateOpportunityById")
    public DataResponse updateOpportunityById(@RequestBody Opportunity opportunity) {
        Boolean result = opportunityService.updateOpportunityId(opportunity);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-新增商机-通过客户id查询联系人列表
     * @param customerId 客户id
     * @return
     */
    @PostMapping("/contactByCustomerIdList")
    public DataResponse contactByCustomerIdList(@RequestParam(value="customerId",required = false) String customerId) {

        try{
            List<Contact> list = contactService.contactByCustomerIdList(customerId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity contactByCustomerIdList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-新增商机-过客户id查询联系人列表  分页
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param customerId 客户id
     * @return
     */
    @PostMapping("/pageContactByCustomerIdList")
    public DataResponse pageContactByCustomerIdList(HttpServletRequest request,
                                    @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                    @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                    @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                    @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                    @RequestParam(value="customerId",required = false) String customerId) {

        try{
            DhPageInfo<Contact> list = contactService.pageContactByCustomerIdList(pageIndex,pageSize,sortName,sortOrder,customerId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity pageContactByCustomerIdList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-新增商机-查询所有产品列表
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param productName 产品名称
     * @param productCategories 产品分类：0-非会员；1-会员
     * @return
     */
    @PostMapping("/productList")
    public DataResponse productList(HttpServletRequest request,
                                    @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                    @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                    @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                    @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                    @RequestParam(value="productName",required = false) String productName,
                                    @RequestParam(value="productCategories",required = false) String productCategories) {

        try{
            DhPageInfo<CustomerProduct> list = customerProductService.productList(pageIndex,pageSize,sortName,sortOrder,productName,productCategories);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity productList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-新增商机-查询商机下的产品
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/opportunityProductList")
    public DataResponse opportunityProductList(HttpServletRequest request,
                                    @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                    @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                    @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                    @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                    @RequestParam(value="opportunityId",required = false) String opportunityId,
                                    @RequestParam(value="whetherRenew",required = false) Integer whetherRenew) {

        try{
            DhPageInfo<OpportunityProduct> list = opportunityProductService.opportunityProductList(pageIndex,pageSize,sortName,sortOrder,opportunityId,whetherRenew);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity productList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增商机产品
     * @param opportunityProduct 商机产品实体
     * @return
     */
    @PostMapping("/addOpportunityProduct")
    public DataResponse addOpportunityProduct(@RequestBody OpportunityProduct opportunityProduct) {

        String result = opportunityProductService.addOpportunityProduct(opportunityProduct);
        if("success".equals(result)){
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        }
        if("EX0001".equals(result)){
            return new DhResponse(ResponseCodeEnum.OPPORTUNITYPRODUCT_EX.getResponseCode());
        }
        return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
    }

    /**
     * 商机-商机详情-修改商机产品回显
     * @param opportunityProductId 商机产品id
     * @return
     */
    @PostMapping("/getOpportunityProductById")
    public DataResponse getOpportunityProductById(@RequestParam(value="opportunityProductId",required = false) String opportunityProductId) {
        try{
            OpportunityProduct opportunityProduct = opportunityProductService.getOpportunityProductById(opportunityProductId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),opportunityProduct);
        }catch(Exception e){
            log.error("opportunity phrase error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-修改商机产品
     * @param opportunityProduct 商机产品实体
     * @return
     */
    @PostMapping("/updateOpportunityProduct")
    public DataResponse updateOpportunityProduct(@RequestBody OpportunityProduct opportunityProduct) {
        Boolean result = opportunityProductService.updateOpportunityProduct(opportunityProduct);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-删除商机产品
     * @param opportunityProduct 商机产品实体
     * @return
     */
    @PostMapping("/deleteOpportunityProduct")
    public DataResponse deleteOpportunityProduct(@RequestBody OpportunityProduct opportunityProduct) {
        Boolean result = opportunityProductService.deleteOpportunityProduct(opportunityProduct);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }



    /**
     * 商机-商机详情-查询所有用户
     * @return
     */
    @PostMapping("/userList")
    public DataResponse userList(@RequestParam(value="opportunityId",required = false) String opportunityId) {
        try{
            List<OpportunityCollaboratorVO> list = opportunityCollaboratorService.userList(opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity userList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增协作人
     * @param opportunityCollaborator 商机协作人实体
     * @return
     */
    @PostMapping("/addOpportunityCollaborator")
    public DataResponse addOpportunityCollaborator(@RequestBody OpportunityCollaborator opportunityCollaborator) {
        Boolean result = opportunityCollaboratorService.addOpportunityCollaborator(opportunityCollaborator);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-查询当前商机的协作人
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/opportunityCollaboratorList")
    public DataResponse opportunityCollaboratorList(@RequestParam(value="opportunityId",required = false) String opportunityId) {
        try{
            List<OpportunityCollaborator> list = opportunityCollaboratorService.opportunityCollaboratorList(opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityCollaboratorList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-商机协作人-删除
     * @param opportunityCollaboratorId 协作人id
     * @return
     */
    @PostMapping("/deleteOpportunityCollaborator")
    public DataResponse deleteOpportunityCollaborator(@RequestParam(value="opportunityCollaboratorId",required = false) String opportunityCollaboratorId) {
        try{
            Boolean result = opportunityCollaboratorService.deleteOpportunityCollaborator(opportunityCollaboratorId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),result);
        }catch(Exception e){
            log.error("opportunity deleteOpportunityCollaborator error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增商机动态
     * @param clueFollowQO 商机动态和跟进记录信息
     * @return
     */
    @PostMapping("/addOpportunityDynamic")
    public DataResponse addOpportunityDynamic(@RequestBody ClueFollowQO clueFollowQO) {
        try {
            List<OpportunityDynamicVO> list = opportunityDynamicService.addOpportunityDynamic(clueFollowQO);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(), list);
        }catch(Exception e){
            log.error("opportunity addOpportunityDynamic error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-查询当前商机动态
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/opportunityDynamicList")
    public DataResponse opportunityDynamicList(@RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                               @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                               @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                               @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                               @RequestParam(value="opportunityId",required = false) String opportunityId) {
        try{
            DhPageInfo<OpportunityDynamicVO> list = opportunityDynamicService.opportunityDynamicList(pageIndex,pageSize,sortName,sortOrder,opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityDynamicList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-常用语展示
     * @return
     */
    @PostMapping("/phraseList")
    public DataResponse phraseList() {
        try{
            List<Phrase> list = opportunityPhraseService.phraseList();
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity phraseList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增常用语
     * @param phrase 常用语实体
     * @return
     */
    @PostMapping("/addPhrase")
    public DataResponse addPhrase(@RequestBody Phrase phrase) {
        try{
            String result = opportunityPhraseService.addPhrase(phrase);
            if("CY0001".equals(result)){
                return new DhResponse(ResponseCodeEnum.PHRASE_EXCEED.getResponseCode());
            }
            if("SUCCESS".equals(result)){
                return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
            }
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }catch(Exception e){
            log.error("opportunity addPhrase error:", e);
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-修改常用语回显
     * @param phraseId 常用语id
     * @return
     */
    @PostMapping("/getPhraseById")
    public DataResponse getPhraseById(@RequestParam(value="phraseId",required = false) String phraseId) {
        try{
            Phrase phrase = opportunityPhraseService.getPhraseById(phraseId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),phrase);
        }catch(Exception e){
            log.error("opportunity phrase error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-修改常用语
     * @param phrase 常用语实体
     * @return
     */
    @PostMapping("/updatePhrase")
    public DataResponse updatePhrase(@RequestBody Phrase phrase) {
        Boolean result = opportunityPhraseService.updatePhrase(phrase);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增常用语集合
     * @param names 常用语集合
     * @return
     */
    @PostMapping("/addPhraseList")
    public DataResponse addPhraseList(@RequestBody String[] names) {
        Boolean result = opportunityPhraseService.addPhraseList(names);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }



    /**
     * 商机管理-删除常用语
     * @param phraseId 常用语id
     * @return
     */
    @PostMapping("/deletePhrase")
    public DataResponse deletePhrase(@RequestParam(value="phraseId",required = false) String phraseId) {
        Boolean result = opportunityPhraseService.deletePhrase(phraseId);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-查询当前商机联系人
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/opportunityContactList")
    public DataResponse opportunityContactList(HttpServletRequest request,
                                               @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                               @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                               @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                               @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                               @RequestParam(value="opportunityId",required = false) String opportunityId) {

        try{
            DhPageInfo<OpportunityContact> list = opportunityContactService.opportunityContactList(pageIndex,pageSize,sortName,sortOrder,opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity productList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-商机详情-新增联系人到商机联系人下
     * @param opportunityContact 商机联系人实体
     * @return
     */
    @PostMapping("/addOpportunityContact")
    public DataResponse addOpportunityContact(@RequestBody OpportunityContact opportunityContact) {
        Boolean result = opportunityContactService.addOpportunityContact(opportunityContact);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     *商机详情-商机联系人 开启/废止联系人
     * @param opportunityContact 废止商机联系人实体
     * @return
     */
    @PostMapping("/updateAbolishState")
    public DataResponse updateAbolishState(@RequestBody OpportunityContact opportunityContact) {
        try{
            Boolean result =  opportunityContactService.updateAbolishStateById(opportunityContact);
            if(result){
                return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
            }
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }catch(Exception e){
            log.error("customer updateAbolishState error:", e);
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     *商机详情--商机联系人-修改联系人类型-为首要联系人
     * @param opportunityContact 商机联系人实体
     * @return
     */
    @PostMapping("/updateContactType")
    public DataResponse updateContactType(@RequestBody OpportunityContact opportunityContact) {
        try{
            Boolean result =  opportunityContactService.updateContactType(opportunityContact);
            if(result){
                return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
            }
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }catch(Exception e){
            log.error("customer updateContactType error:", e);
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * @Description:合同管理-根据客户Id查询商机列表
     * @Param:  * @param customerId
     * @Author: luojie
     * @Date: 2021/3/16 11:00
     */
    @GetMapping("/selectOpportunityListByCustomerId")
    public DataResponse selectOpportunityListByCustomerId(@RequestParam(value="customerId") String customerId){
        try{
            List<Opportunity>  list = opportunityService.selectOpportunityListByCustomerId(customerId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("customer selectContactPersonListByCustomerId error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机状态统计
     * @param opportunityStatusQO dateType  thisMonth 本月 thisQuarter 本季度  thisYear 本年
     * @param opportunityStatusQO bs 0管理端 1用户端
     * @param opportunityStatusQO name 公司id
     * @param opportunityStatusQO startTime 开始时间
     * @param opportunityStatusQO endTime 结束时间
     * @return
     */
    @PostMapping("/oppStatusStatistics")
    public DataResponse oppStatusStatistics(@RequestBody OpportunityStatusQO opportunityStatusQO){
        try{
            List<Integer>  list = new ArrayList<>();
            if(!StringUtils.isBlank(opportunityStatusQO.getAccountId())){
                list = opportunityService.oppStatusStatisticsAdmin(opportunityStatusQO);
            }else{
                list = opportunityService.oppStatusStatistics(opportunityStatusQO);
            }

            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("customer oppStatusStatistics error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机产品比重
     * @param dateType thisMonth 本月 thisQuarter 本季度  thisYear 本年
     * @param bs 0管理端 1用户端
     * @return
     */
    @PostMapping("/oppProductStatistics")
    public DataResponse oppProductStatistics(@RequestParam(value = "dateType", required = true) String dateType,
                                             @RequestParam(value = "bs", required = true) String bs){
        try{
            List<OpportunityProductVO>  list = opportunityService.oppProductStatistics(dateType,bs);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("customer oppProductStatistics error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 管理模块 --商机分布--商机列表
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则(asc/desc)
     * @param dateType thisMonth 本月 thisQuarter 本季度  thisYear 本年
     * @param bs 0管理端 1用户端
     * @return
     */
    @PostMapping("/selectOppStatistics")
    public DataResponse selectOppStatistics(HttpServletRequest request,
                                                @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                                @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                                @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                                @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                                @RequestParam(value = "dateType", required = true) String dateType,
                                                @RequestParam(value = "bs", required = true) String bs
    ){
        try{
            DhPageInfo<OpportunityStatisticsVO> list = opportunityService.selectOppStatistics(pageIndex,pageSize,sortName,sortOrder,dateType,bs);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity selectOpportunityVoList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-新增商机-查询商机下的赠品
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/opportunityGiftList")
    public DataResponse opportunityGiftList(HttpServletRequest request,
                                               @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                               @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                               @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                               @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                               @RequestParam(value="opportunityId",required = false) String opportunityId) {

        try{
            DhPageInfo<OpportunityGift> list = opportunityGiftService.opportunityGiftList(pageIndex,pageSize,sortName,sortOrder,opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityGiftList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-新增商机赠品
     * @param opportunityGift 商机赠品实体
     * @return
     */
    @PostMapping("/addOpportunityGift")
    public DataResponse addOpportunityGift(@RequestBody OpportunityGift opportunityGift) {

        String result = opportunityGiftService.addOpportunityGift(opportunityGift);
        if("success".equals(result)){
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        }
        if("EX0001".equals(result)){
            return new DhResponse(ResponseCodeEnum.OPPORTUNITYPRODUCT_EX.getResponseCode());
        }
        return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
    }

    /**
     * 商机-商机详情-修改商机赠品回显
     * @param opportunityGiftId 商机赠品id
     * @return
     */
    @PostMapping("/getOpportunityGiftById")
    public DataResponse getOpportunityGiftById(@RequestParam(value="opportunityGiftId",required = false) String opportunityGiftId) {
        try{
            OpportunityGift opportunityGift = opportunityGiftService.getOpportunityGiftById(opportunityGiftId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),opportunityGift);
        }catch(Exception e){
            log.error("opportunity getOpportunityGiftById error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-修改商机赠品
     * @param opportunityGift 商机赠品实体
     * @return
     */
    @PostMapping("/updateOpportunityGift")
    public DataResponse updateOpportunityProduct(@RequestBody OpportunityGift opportunityGift) {
        Boolean result = opportunityGiftService.updateOpportunityGift(opportunityGift);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-删除商机赠品
     * @param opportunityGift 商机赠品实体
     * @return
     */
    @PostMapping("/deleteOpportunityGift")
    public DataResponse deleteOpportunityGift(@RequestBody OpportunityGift opportunityGift) {
        Boolean result = opportunityGiftService.deleteOpportunityGift(opportunityGift);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 根据客户id查询联系人信息
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则(asc/desc)
     * @param customerId 客户id
     * @return
     */
    @PostMapping("/contactByCustIdList")
    public DataResponse customerContactPersonList(
            @RequestParam(value = "pageIndex", required = true) Integer pageIndex,
            @RequestParam(value = "pageSize", required = true) Integer pageSize,
            @RequestParam(value="sortName",required = false) String sortName,
            @RequestParam(value="sortOrder",required = false) String sortOrder,//排序(asc/desc)
            @RequestParam(value="customerId") String customerId){
        try{
            DhPageInfo<Contact>  list = contactService.contactByCustIdList(pageIndex,pageSize,sortName,sortOrder,customerId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity contactByCustomerIdList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * @Description:商机添加合同赋值
     * @Param:  * @param opportunityId 商机id
     * @param contractType 合同类型--1:非会员合同;2:会员新单合同;3:活动合同;4:会员续费合同
     * @Author: baijian
     * @Date: 2021/4/15 11:08
     */
    @PostMapping("/opportunityContractDetail")
    public DataResponse opportunityContractDetail(@RequestParam(value="contractType",required = false) String contractType,
                                                  @RequestParam(value="opportunityId",required = false) String opportunityId){
        try{
            CustomerContractEditVO customerContractEditVO = customerContractService.opportunityContractDetail(opportunityId,contractType);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),customerContractEditVO);
        }catch(Exception e){
            log.error("opportunity opportunityContractDetail error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-需求分析
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/demandAnalysisList")
    public DataResponse demandAnalysisList(HttpServletRequest request,
                                            @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                            @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                            @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                            @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                            @RequestParam(value="opportunityId",required = false) String opportunityId) {

        try{
            DhPageInfo<DemandAnalysis> list = demandAnalysisService.demandAnalysisList(pageIndex,pageSize,sortName,sortOrder,opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityGiftList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-商机详情-新增需求分析
     * @param demandAnalysis 需求分析实体
     * @return
     */
    @PostMapping("/addDemandAnalysis")
    public DataResponse addDemandAnalysis(@RequestBody DemandAnalysis demandAnalysis) {

        boolean result = demandAnalysisService.addDemandAnalysis(demandAnalysis);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-修改需求分析
     * @param demandAnalysisId 需求分析id
     * @return
     */
    @PostMapping("/getDemandAnalysisById")
    public DataResponse getDemandAnalysisById(@RequestParam(value="demandAnalysisId",required = false) String demandAnalysisId) {
        try{
            DemandAnalysis demandAnalysis = demandAnalysisService.getDemandAnalysisById(demandAnalysisId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),demandAnalysis);
        }catch(Exception e){
            log.error("opportunity getOpportunityGiftById error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-修改需求分析
     * @param demandAnalysis 需求分析实体
     * @return
     */
    @PostMapping("/updateDemandAnalysis")
    public DataResponse updateDemandAnalysis(@RequestBody DemandAnalysis demandAnalysis) {
        Boolean result = demandAnalysisService.updateDemandAnalysis(demandAnalysis);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-删除需求分析
     * @param demandAnalysis 需求分析实体
     * @return
     */
    @PostMapping("/deleteDemandAnalysis")
    public DataResponse deleteDemandAnalysis(@RequestBody DemandAnalysis demandAnalysis) {
        Boolean result = demandAnalysisService.deleteDemandAnalysis(demandAnalysis);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-需求调研
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/demandResearchList")
    public DataResponse demandResearchList(HttpServletRequest request,
                                           @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                           @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                           @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                           @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                           @RequestParam(value="opportunityId",required = false) String opportunityId) {

        try{
            DhPageInfo<DemandResearch> list = demandResearchService.demandResearchList(pageIndex,pageSize,sortName,sortOrder,opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityGiftList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机管理-商机详情-新增需求调研
     * @param demandResearch 需求调研实体
     * @return
     */
    @PostMapping("/addDemandResearch")
    public DataResponse addDemandResearch(@RequestBody DemandResearch demandResearch) {

        boolean result = demandResearchService.addDemandResearch(demandResearch);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-修改需求调研
     * @param demandResearchId 需求调研id
     * @return
     */
    @PostMapping("/getDemandResearchById")
    public DataResponse getDemandResearchById(@RequestParam(value="demandResearchId",required = false) String demandResearchId) {
        try{
            DemandResearch demandResearch = demandResearchService.getDemandResearchById(demandResearchId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),demandResearch);
        }catch(Exception e){
            log.error("opportunity getOpportunityGiftById error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-修改需求调研
     * @param demandResearch 需求调研实体
     * @return
     */
    @PostMapping("/updateDemandResearch")
    public DataResponse updateDemandResearch(@RequestBody DemandResearch demandResearch) {
        Boolean result = demandResearchService.updateDemandResearch(demandResearch);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-删除需求调研
     * @param demandResearch 需求调研实体
     * @return
     */
    @PostMapping("/deleteDemandResearch")
    public DataResponse deleteDemandResearch(@RequestBody DemandResearch demandResearch) {
        Boolean result = demandResearchService.deleteDemandResearch(demandResearch);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-竞品分析
     * @param pageIndex 页码
     * @param pageSize 分页大小
     * @param sortName 排序列名字
     * @param sortOrder 排序规则
     * @param opportunityId 商机id
     * @return
     */
    @PostMapping("/competitorList")
    public DataResponse competitorList(HttpServletRequest request,
                                           @RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                           @RequestParam(value = "pageSize", required = true) Integer pageSize,//分页大小
                                           @RequestParam(value="sortName",required = false) String sortName,//排序列名字
                                           @RequestParam(value="sortOrder",required = false) String sortOrder,//排序规则(asc/desc)
                                           @RequestParam(value="opportunityId",required = false) String opportunityId) {

        try{
            DhPageInfo<Competitor> list = competitorService.competitorList(pageIndex,pageSize,sortName,sortOrder,opportunityId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity competitorList error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机-商机详情-修改竞品分析
     * @param competitorId 竞品分析id
     * @return
     */
    @PostMapping("/getCompetitorById")
    public DataResponse getCompetitorById(@RequestParam(value="competitorId",required = false) String competitorId) {
        try{
            Competitor competitor = competitorService.getCompetitorById(competitorId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),competitor);
        }catch(Exception e){
            log.error("opportunity getOpportunityGiftById error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-修改竞品分析
     * @param competitor 竞品分析实体
     * @return
     */
    @PostMapping("/updateCompetitor")
    public DataResponse updateCompetitor(@RequestBody Competitor competitor) {
        Boolean result = competitorService.updateCompetitor(competitor);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-删除竞品分析
     * @param competitor 竞品分析实体
     * @return
     */
    @PostMapping("/deleteCompetitor")
    public DataResponse deleteCompetitor(@RequestBody Competitor competitor) {
        Boolean result = competitorService.deleteCompetitor(competitor);
        if (result) {
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode());
        } else {
            return new DhResponse(ResponseCodeEnum.SERVICE_ERROR.getResponseCode());
        }
    }

    /**
     * 管理员-商机状态统计
     * @param opportunityStatusQO dateType thisLastMonth 上月  thisMonth 本月 thisQuarter 本季度  thisYear 本年  section 区间
     * @param opportunityStatusQO startTime 起始时间
     * @param opportunityStatusQO endTime 截止时间
     * @return
     */
    @PostMapping("/adminOppStatusStatistics")
    public DataResponse adminOppStatusStatistics(@RequestBody OpportunityStatusQO opportunityStatusQO){
        try{
            Map<String,Object> list = opportunityService.adminOppStatusStatistics(opportunityStatusQO);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity adminOppStatusStatistics error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 管理员-业绩排名
     * @param opportunityStatusQO dateType thisLastMonth 上月  thisMonth 本月 thisQuarter 本季度  thisYear 本年  section 区间
     * @param opportunityStatusQO startTime 起始时间
     * @param opportunityStatusQO endTime 截止时间
     * @return
     */
    @PostMapping("/performanceRanking")
    public DataResponse performanceRanking(@RequestBody OpportunityStatusQO opportunityStatusQO){
        try{
            List<PerformanceRankingVO> list = opportunityService.performanceRanking(opportunityStatusQO);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity performanceRanking error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 统计商机数据一览
     * @return
     */
    @PostMapping("/oppDataStatistics")
    public DataResponse oppDataStatistics(){
        try{
            Map<String,OpportunityDataVO> map = opportunityService.oppDataStatistics();
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),map);
        }catch(Exception e){
            log.error("opportunity oppDataStatistics error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机合同占比
     * @param dateType thisLastMonth 上月 thisWeek 本周  thisMonth 本月
     * @return
     */
    @PostMapping("/oppContractProportion")
    public DataResponse oppContractProportion(@RequestParam(value="dateType",required = false) String dateType){
        try{
            List<OpportunityProductVO> list = opportunityService.oppContractProportion(dateType,"0");
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity oppContractProportion error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机合同类型比例
     * @param dateType thisLastMonth 上月 thisWeek 本周  thisMonth 本月
     * @return
     */
    @PostMapping("/oppContractTypeProportion")
    public DataResponse oppContractTypeProportion(@RequestParam(value="dateType",required = false) String dateType){
        try{
            List<OpportunityProductVO> list = opportunityService.oppContractProportion(dateType,"1");
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity oppContractTypeProportion error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机成交额比例
     * @param dateType thisLastMonth 上月 thisWeek 本周  thisMonth 本月
     * @return
     */
    @PostMapping("/oppTurnoverProportion")
    public DataResponse oppTurnoverProportion(@RequestParam(value="dateType",required = false) String dateType){
        try{
            List<OpportunityProductVO> list = opportunityService.oppContractProportion(dateType,"2");
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity oppContractTypeProportion error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机拥有数排行
     * @param bs 1赢单排行  2总数排行
     * @return
     */
    @PostMapping("/oppOfNumber")
    public DataResponse oppOfNumber(@RequestParam(value="bs",required = false) Integer bs){
        try{
            List<OpportunityOfNumberVO> list = opportunityService.oppOfNumber(bs);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity oppOfNumber error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机状态个数跟进占比意向占比
     * @param dateType thisLastMonth 上月 thisWeek 本周  thisMonth 本月
     * @return
     */
    @PostMapping("/opportunityFollowIntentionZb")
    public DataResponse opportunityFollowIntentionZb(@RequestParam(value="dateType",required = false) String dateType){
        try{
            List<OpportunityFollowIntentionZbVO> list = opportunityService.opportunityFollowIntentionZb(dateType);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityFollowIntentionZb error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

    /**
     * 商机详情-查询商机客户下面未过期的合同
     * @param customerId 客户id
     * @return
     */
    @PostMapping("/opportunityCustomerContract")
    public DataResponse opportunityCustomerContract(@RequestParam(value="customerId",required = false) String customerId){
        try{
            List<CustomerContractVO> list = customerContractService.opportunityCustomerContract(customerId);
            return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
        }catch(Exception e){
            log.error("opportunity opportunityCustomerContract error:", e);
            return new DhResponse(ResponseCodeEnum.ERROR.getResponseCode());
        }
    }

//    /**
//     * 商机管理-新增商机-会员产品列表
//     * @return
//     * @author baijian
//     */
//    @PostMapping("/selectCustomerMemberProductListNoPage")
//    public DataResponse selectCustomerMemberProductListNoPage(@RequestParam(value = "productStatus", required = false) String productStatus,//查询条件
//                                                          @RequestParam(value = "memberCardName", required = false) String memberCardName //会员卡名称
//    ){
//        List<CustomerMemberProduct> list = memberProductService.selectCustomerMemberProductListNoPage(productStatus,memberCardName);
//        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),list);
//    }




}
